UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4PDrJrudjuvtwVSUyA/C8Iu684egJWzdvnKfYhn1BaY=' 
WHERE 
  key_id = '183368159d8aadb5e16f150c27792ef276c2dd0ec03c253bba02eb75754101b7' 
  AND (
    token = '4PDrJrudjuvtwVSUyA/C8Iu684egJWzdvnKfYhn1BaY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044