UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+2hNCSOVt71hv6OjJEluMl2PGv01uy/p8XkU/sl1lTI='
WHERE
key_id = '821cc90048ff5fc843c74bd462505f58cdd2202ec9b7ada33dd392d7d065fd02'
AND (
token = '+2hNCSOVt71hv6OjJEluMl2PGv01uy/p8XkU/sl1lTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)