UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GF43Moh//s3Nxe1LhUPusjqgqL/UUEq1gN13k3Deg1I='
WHERE
key_id = 'c187e8bf90e757137b41db804a9fff3b907016323aedc0c27ca185f8c2beb2cf'
AND (
token = 'GF43Moh//s3Nxe1LhUPusjqgqL/UUEq1gN13k3Deg1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)