UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bi3DfURBZlraCTi4198QF7eh2Dyc4kS/gPrYub7tSLE=' 
WHERE 
  key_id = 'd190542012511d2ff3d851cfd52edc9d5847548697a59eafeffea721d1db64ac' 
  AND (
    token = 'bi3DfURBZlraCTi4198QF7eh2Dyc4kS/gPrYub7tSLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037