UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z3X0g09D5gVNwUKOxrW5q/EZBgoJOBLt6szhQPrbIXA=' 
WHERE 
  key_id = 'e30fc3fb815c82f2b12771dafcce71a0fbb9f56c803b9ea42a81350200b083a3' 
  AND (
    token = 'Z3X0g09D5gVNwUKOxrW5q/EZBgoJOBLt6szhQPrbIXA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033