UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JDDFcph8IauVwMobQrFlXWZ6r6T5zSK6lgWr3HcF50=' 
WHERE 
  key_id = 'e2c73a586387ad1ad79560a3ef62bc3c81080c7ec3eb69a4fa4ba0f7a00c6021' 
  AND (
    token = '5JDDFcph8IauVwMobQrFlXWZ6r6T5zSK6lgWr3HcF50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032