UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fo/Siq3fTUiembJP1tgLx9Y7uDDwQxh4cPktQa7bAuI='
WHERE
key_id = 'd0355ace693a61eccd2d9cb28627c5e87d3b876d6a89d3384b53a4280c656bc1'
AND (
token = 'fo/Siq3fTUiembJP1tgLx9Y7uDDwQxh4cPktQa7bAuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)