UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VAJcLkbTx6/nw9vB6MfB8CosYkUUVivAD7pHHKGfOdk='
WHERE
key_id = '46731626eb85161fbfc94ce5a5e27b42918df5c4198ad6110b22b4f2731fc741'
AND (
token = 'VAJcLkbTx6/nw9vB6MfB8CosYkUUVivAD7pHHKGfOdk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)