UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZCu4lJpROyWGcNOtNoT1wF94Y5KR2+4BAiy4MuIUt48='
WHERE
key_id = 'fefa9bf148ac1a6ba8e751892f994a9b4ac9ac96d89bbe502eecd954a932cf4c'
AND (
token = 'ZCu4lJpROyWGcNOtNoT1wF94Y5KR2+4BAiy4MuIUt48='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)