UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VYpSNPX4dii/WXuOzQOjVUNEEONOcaJ5H+YqNwqcJFk=' 
WHERE 
  key_id = '3ca08da013a9db1c12013f2d9e382b0224d14ceecc20aa353947c7fcf9d2d568' 
  AND (
    token = 'VYpSNPX4dii/WXuOzQOjVUNEEONOcaJ5H+YqNwqcJFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024