UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c/fp1SDsMITQbIAGpU3EtzqWnVW6RJU1Myz5fe2sjRI='
WHERE
key_id = 'bf05dcb4e35831801d9373b65c58cfb95f467ae2dd5e63b793c6f2437ba4cab9'
AND (
token = 'c/fp1SDsMITQbIAGpU3EtzqWnVW6RJU1Myz5fe2sjRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)