UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CIxeqA+omQ2E+6vWSo6N6UBXJ0GEKgVT6eEhLMW5mfA='
WHERE
key_id = '0315b91c6aae5f051e4c1a4c505039ce3da50f36f90a054ab8c94a76763ecbcd'
AND (
token = 'CIxeqA+omQ2E+6vWSo6N6UBXJ0GEKgVT6eEhLMW5mfA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)