UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nC3LxbD1Uez8fz+VSYt0RUG7PREIIXRMf50Z5KF/k48=' 
WHERE 
  key_id = '6fcfed3d5ab12a2cabe3b5c8e08e73cc114995c018db08c96e03e2da8b3be34f' 
  AND (
    token = 'nC3LxbD1Uez8fz+VSYt0RUG7PREIIXRMf50Z5KF/k48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019