UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lmKpvRtunQXFQAFuIMJ6jLFSAgihfwkG2/teXojcTDU=' 
WHERE 
  key_id = 'f4873bf263bd89364764cc7ec23b5bb2943dcac83d91a060dbb3aee2b44a761f' 
  AND (
    token = 'lmKpvRtunQXFQAFuIMJ6jLFSAgihfwkG2/teXojcTDU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00091