UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Asy87Tobc3pdlU9CiWJN9pdjtfqcm/rX2z+YPy6sv9w=' 
WHERE 
  key_id = '75cf08919b1f7cf5a816e3fa5ef8aea1d4359ec277e861db2d44cb737e43374e' 
  AND (
    token = 'Asy87Tobc3pdlU9CiWJN9pdjtfqcm/rX2z+YPy6sv9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057