UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ilNt1rjEq96pUqgNeKOlSSymYUJ7S5bzW8DFq25pGY=' 
WHERE 
  key_id = '0d1dc8b14ad5979d5e3a029e1422d6ad81be559e52f8111c6df669423ce728f0' 
  AND (
    token = '0ilNt1rjEq96pUqgNeKOlSSymYUJ7S5bzW8DFq25pGY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022