UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GvTheUptSHr5JX5RC0cgHNVx5/sZtEUSu007fV7HDxU=' 
WHERE 
  key_id = 'edc8d9a3b807f2889d27b2ab71f8cd72016a7dc987870c9cce2196d3daf2d657' 
  AND (
    token = 'GvTheUptSHr5JX5RC0cgHNVx5/sZtEUSu007fV7HDxU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027