UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PbyMMHianq6Ox3S7eVdAjDjAsAbdaiJn0rBPI5VGock=' 
WHERE 
  key_id = '8e1e8b6989d6c9d5d0975d67bfd63fe141d5ecc1ce28e57a438492561f775103' 
  AND (
    token = 'PbyMMHianq6Ox3S7eVdAjDjAsAbdaiJn0rBPI5VGock=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054