UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6q+8Pb02r8KD1R9u8qaoG4jrzgxaMwqcvBJKp4qc5Qk=' 
WHERE 
  key_id = 'fec2b23cccb9de460cfa15469f71cca3e126b69399183814f0b6955525c4b574' 
  AND (
    token = '6q+8Pb02r8KD1R9u8qaoG4jrzgxaMwqcvBJKp4qc5Qk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039