UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm7jQHawspSMQDZE+yeJPc9w6UVs88lITTPUgYCFzpG0=' 
WHERE 
  key_id = '7461201f688a31d6ed071a2f750a201fdf6160d852790bed3cb80d1161fd01e4' 
  AND (
    token = 'm7jQHawspSMQDZE+yeJPc9w6UVs88lITTPUgYCFzpG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031