UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LM+h68cyl5fWMvysBW0FJffmbAP1Ow7KdVg1TqtgS1I=' 
WHERE 
  key_id = '1ff476737bc59cd0343a3b8836e9d011954a067954481e5b515e2e12387fca11' 
  AND (
    token = 'LM+h68cyl5fWMvysBW0FJffmbAP1Ow7KdVg1TqtgS1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019