UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QOQN/U6MpuQB0UR5dJU8CVYtnap03j2sQJoT+bHuGKw=' 
WHERE 
  key_id = '0bbd873db5c5ff0c8a3131ffeac980c3066c53b5ccca1625d5987cb6b1f11fdb' 
  AND (
    token = 'QOQN/U6MpuQB0UR5dJU8CVYtnap03j2sQJoT+bHuGKw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044