UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fuM6GU0fP/4kHx1X4WI8p96aSMpaMJQuyukD/ZR7UCk=' 
WHERE 
  key_id = '7837c367da115ad49da5a6a169dbdf96c2c75ac8e6da723d5f0e541d6006c8b3' 
  AND (
    token = 'fuM6GU0fP/4kHx1X4WI8p96aSMpaMJQuyukD/ZR7UCk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027