UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y6B7xx88qYA/oIfE46KuTODTDvKzLEqNbLWgIkzkEvM=' 
WHERE 
  key_id = '9936f83c4e2b32a480215a778d129df32a46fadd164ad42b424d7f9df9a803c6' 
  AND (
    token = 'y6B7xx88qYA/oIfE46KuTODTDvKzLEqNbLWgIkzkEvM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034