UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XN/auO6Pqdul1yZN8+L4UxcDexWhyW31HXrvX3e8/U='
WHERE
key_id = '0fd8569fe0b01f64426b3a6d0af5956dca0b6376d0967bc3941350365b190ca3'
AND (
token = '4XN/auO6Pqdul1yZN8+L4UxcDexWhyW31HXrvX3e8/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)