UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rH/UmUW+QJK2M8ZQK98OEePXczrPd/EF36/4lxvqWVE=' 
WHERE 
  key_id = '1224ba980aee8753a3e5135ec919639df552cdf5e04933668ab162f7feffe107' 
  AND (
    token = 'rH/UmUW+QJK2M8ZQK98OEePXczrPd/EF36/4lxvqWVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066