UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TalGn4KswWEzQkI/uDCGZcpxEJ0o3LqVzT08pg6zy9c='
WHERE
key_id = '0e17a708572e29ff2e8fc0b324d378db98c048e8816a39e9bb6fd6ae21a6d5b1'
AND (
token = 'TalGn4KswWEzQkI/uDCGZcpxEJ0o3LqVzT08pg6zy9c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)