UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zwyYGEe/90WeGrF5z016WId3RK98RIVIbg0xqXz/e8g='
WHERE
key_id = '389906f25fc9838cbb3e733db3438971dd8bea9b884d4ec31779f4dee7aad8b3'
AND (
token = 'zwyYGEe/90WeGrF5z016WId3RK98RIVIbg0xqXz/e8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)