UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8BihIeos2UHwRNlqxEIDeh05d2C1b1aSK1ESNiGo5bQ='
WHERE
key_id = '843bc0cd60323048eb92759a18f0d9570b1ef057067c39c866dcef0df8731a9f'
AND (
token = '8BihIeos2UHwRNlqxEIDeh05d2C1b1aSK1ESNiGo5bQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)