UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LtpBzazUXzJOBQoC2k1bECo2FZkx20K/jbGP11bO1MI=' 
WHERE 
  key_id = 'b016338a4f58656e40db626ce4249747f8abb15e6bcbe9de99b6005f0336a229' 
  AND (
    token = 'LtpBzazUXzJOBQoC2k1bECo2FZkx20K/jbGP11bO1MI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043