UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BL0NFPxtz3ksAp5XpreceKb5stJCwK/HPvWXzUq68Ow='
WHERE
key_id = '2ae7aca770fbfa1c2c0d8c0e30f03ff40510771564d8cab4b82012758ef8ddfe'
AND (
token = 'BL0NFPxtz3ksAp5XpreceKb5stJCwK/HPvWXzUq68Ow='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)