UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KPf+qOx6uRC4A4w7PMDmvK05tQ48IHiORSY7vKkg80E='
WHERE
key_id = '751b0b7593ef2ced45046ef58c1a6844b68ed9700445e331595cfbf8795acc54'
AND (
token = 'KPf+qOx6uRC4A4w7PMDmvK05tQ48IHiORSY7vKkg80E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)