UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MKEdO6fPY9eRzGNGjls/C/8N0wEEC93VoY3hKhMt3GI='
WHERE
key_id = '19a034ee4f311da9506f43e5a53f3351a75d282d9e36c8c65b91b7fefe38078f'
AND (
token = 'MKEdO6fPY9eRzGNGjls/C/8N0wEEC93VoY3hKhMt3GI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)