UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+yLICoDW890NLZk14YW2pKVHcPB2PGSdzSbhc4uzxcI='
WHERE
key_id = '3af2120d05f0e40e026b67e8112ffdc4f4fe24ea0ae1722c147d1f58b0c208b5'
AND (
token = '+yLICoDW890NLZk14YW2pKVHcPB2PGSdzSbhc4uzxcI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)