UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o60oxDj4H3nnzPrmtO0u48uVuSsaBCBaFcC9HVHHPN4='
WHERE
key_id = 'c1808974e43c7164c4f68ab752692923c72bfe0d1b17130cc2567d017bf55846'
AND (
token = 'o60oxDj4H3nnzPrmtO0u48uVuSsaBCBaFcC9HVHHPN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)